<?php
/**
 * Represents a field from embrace_model.
 * 
 * @author s.marletta
 * @version $Id: EmbraceField.php 6 2009-04-28 20:11:07Z embrace.toolkit $
 */
class EmbraceField {
	/**
	 * The name of the field.
	 * @var String
	 */
	private $fieldName;
	
	/**
	 * The acces operator of the field.
	 * @var String
	 */
	private $fieldAccess;
	
	/**
	 * The table mapped to the field.
	 * @var String
	 */
	private $fieldTable;
	
	/**
	 * Creates a object of EmbraceField.
	 * 
	 * @param $name Name of the field
	 * @param $access access operator of the field
	 * @param $table name of the table mapped to this field
	 */
	public function EmbraceField($name, $access, $table) {
		if(empty($name))
			throw new Exception("Fieldname must be given.");
			
		$this->fieldAccess = $access;
		$this->fieldName = $name;
		$this->fieldTable = $table;
	}

	/**
	 * returnsthe name of the field.
	 * @return String
	 */
	public function getFieldName() {
		return $this->fieldName;
	}
	
	/**
	 * returns the access operator of the field. 
	 * @return String
	 */
	public function getFieldAccess() {
		return $this->fieldAccess;
	}
	
	/**
	 * returns the table mapped to the field.
	 * @return String
	 */
	public function getFieldTable() {
		return $this->fieldTable;
	}
}
?>